/**
 * @copyright Copyright (c) 2025 
 * CSG Digital Grid Technology (Guangdong) Co., Ltd.
 * @author klg
 * @brief MQTT客户端相关头文件，包含MQTT连接和消息发布接口
 */
#ifndef __MQTT_CLIENT_H__
#define __MQTT_CLIENT_H__



#define STR_TOKEN           "token"
#define STR_TIMESTAMP       "timestamp"
#define STR_license         "license"
#define STR_ESN             "ESN"
#define STR_TIME_TYPE       "time_type"
#define STR_START_TIME      "start_time"
#define STR_END_TIME        "end_time"
#define STR_TIME_SPAN       "time_span"
#define STR_DATA_ROW        "data_row"
#define STR_FROZENTYPE      "frozentype"
#define STR_orderNo         "orderNo"
#define STR_upperN          "upperN"
#define STR_TIMESTARTGATHER "timestartgather"
#define STR_TIMEENDGATHER   "timeendgather"
#define STR_ADDITIONALCHECK "additionalcheck"
#define STR_NAME            "name"
#define STR_TYPE            "type"
#define STR_UNIT            "unit"
#define STR_DEADZONE        "deadzone"
#define STR_RATIO           "ratio"
#define STR_ISREPORT        "isReport"
#define STR_USERDEFINE      "userdefine"
#define STR_VAL             "val"
#define STR_VALUE           "value"
#define STR_QUALITY         "quality"
#define STR_INDEX           "index"
#define STR_TOTALCALL       "totalcall"
#define STR_STATUS          "status"
#define STR_SUB_DEVICE_STATUS "sub_device_status"
#define STR_OK              "OK"
#define STR_FAILURE         "FAILURE"
#define STR_BODY            "body"
#define STR_VERSION         "version"
#define STR_COMPATIBLE      "compatible"
#define STR_SINGLE          "single"
#define STR_FROZEN          "frozen"

#define STR_DEV             "dev"
#define STR_DEV_            "dev_"
#define STR_MODE_           "mode_"
#define STR_MODEL           "model"
#define STR_PORT            "port"
#define STR_ADDR            "addr"
#define STR_DESC            "desc"
#define STR_GUID            "guid"
#define STR_MANUID          "manuID"
#define STR_MANUNAME        "manuName"
#define STR_PROTYPE         "ProType"
#define STR_DEVICETYPE      "deviceType"
#define STR_DEVICENAME      "deviceName"
#define STR_NODEID          "nodeID"
#define STR_PRODUCTID       "productID"
#define STR_APPNAME         "appname"
#define STR_EVENT           "event"

#define STR_HISTORY         "history"
#define STR_SOE             "soe"
#define STR_SOE_STATUS      "soe_status"
#define STR_SOURTYPE        "SourType"
#define STR_UPPERN          "upperN"
#define STR_STARTSN         "StartSN"
#define STR_READCNT         "ReadCnt"
#define STR_STARTTIMESTAMP  "starttimestamp"
#define STR_ENDTIMESTAMP    "endtimestamp"
#define STR_HAPPENSRC       "HappenSrc"
#define STR_ISNEEDRPT       "IsNeedRpt"
#define STR_OCCURNUM        "occurnum"
#define STR_EVENTLEVEL      "EventLevel"
#define STR_Net_1           "Net-1"
#define STR_RPTSTATUS       "RptStatus"
#define STR_DATA            "data"
#define STR_EXTDATA         "extdata"
#define STR_TIME_TYPE       "time_type"
#define STR_TOTALDEV        "totaldev"
#define STR_TOTALEVENT      "totalevent"
#define STR_RPTEVT          "RptEvt"
#define STR_MAXRECSN        "MaxRecSN"

#define STR_ERROR           "error"

#define STR_UID             "uid"
#define STR_TIMEOUT         "timeout"


#define UPDATE_REGIST   "datacenter/notify/spont/allApp/Updateregister" /* 设备/APP 注册通知 */
#define UPDATE_UNREGIST "datacenter/notify/spont/allApp/Delregister"    /* 设备/APP 取消注册通知 */

#define UPDATE_SOE_EVENT   "datacenter/notify/spont/%s/RptEvtRpt"   /* 通知SOE事件 */


int mqtt_publish_message(char *topic, char *payload, int payload_len);
void mqtt_client_init(void);
void mqtt_client_destory(void);


#endif  /* __MQTT_CLIENT_H__ */
